﻿using CRM.Models;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;

namespace CRM.Controllers.Email
{
    [Route("api/[controller]")]
    [ApiController]
    public class EmailServerSendController : BaseController
    {
        private readonly MyDbContext _dbContext;
        private readonly UserManager<User> _userManager;

        public EmailServerSendController(MyDbContext dbContext, UserManager<User> userManager)
        {
            _dbContext = dbContext;
            _userManager = userManager;
        }

        // [HttpGet(nameof(Index))]
        // public async Task<ResultStruct> Index()
        // {
        //     return Success(await _dbContext.EmailServerSend.ToPaginateAsync());
        // }
        //
        // [HttpGet(nameof(SendingFree))]
        // public async Task<ResultStruct> SendingFree()
        // {
        //     return Success(await _dbContext.EmailServerSend.Where(m => m.SendingType == EmailServerSend.SendingTypeEnum.Free).ToPaginateAsync());
        // }        
        //
        // [HttpGet(nameof(SendingByServer))]
        // public async Task<ResultStruct> SendingByServer()
        // {
        //     return Success(await _dbContext.EmailServerSend.Where(m => m.SendingType == EmailServerSend.SendingTypeEnum.Server).ToPaginateAsync());
        // }
        //
        //
        // // GET
        // [HttpPost(nameof(Create))]
        // public async Task<ResultStruct> Create(EmailServerSendCreateVM vm)
        // {
        //     if (!ModelState.IsValid) return Error(message: ModelState.ToString());
        //     var model = vm.NewModel();
        //     System.Console.WriteLine(model);
        //     await _dbContext.EmailServerSend.AddAsync(model);
        //     await _dbContext.SaveChangesAsync();
        //     return Success();
        // }
        //
        // [HttpGet(nameof(Info))]
        // public async Task<ResultStruct> Info([FromQuery] int id)
        // {
        //     return Success(await _dbContext.EmailServerSend.FindAsync(id));
        // }
        
    }
}